package runoob_code;

public class max_int {
    /** 返回两个整型变量数据的较大值 */
    public static int max(int num1, int num2) {
        int result;
        if (num1 > num2)
            result = num1;
        else
            result = num2;

        return result;
    }

    public static void main(String[] args) {
        int a = 1;
        int b = 2;
        System.out.println("更大的数是"+max(a,b));
    }
}
